package com.xbongbong.paas.feign;

import com.xbongbong.admin.pojo.dto.MirrorRollBackDTO;
import com.xbongbong.paas.pojo.dto.FormDataGetDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author WuHB
 * @date 2022/11/16 18:39
 */
@FeignClient(name = "xbb-work-order-web", contextId = "workOrderClient")
public interface WorkOrderClient {

    /**
     * 获取回执单的打印数据
     *
     * @param formGetDto formGetDto
     * @param lang       lang
     * @return 打印模板字段
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/common/detail/get", method = RequestMethod.POST)
    String getFormData(FormDataGetDTO formGetDto, @RequestParam("lang") String lang);


    /**
     * SLA规则列表接口
     * @param slaListDTO 入参
     * @return 接口返回
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/sla/list", method = RequestMethod.POST)
    String slaRuleList(@RequestBody Map<String,Object> slaListDTO, @RequestParam("lang") String lang);


    /**
     * 工单v2应用镜像 回退到初始化
     * @param mirrorRollBackDTO 回退参数
     * @return 接口返回
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/init/rollbackInit", method = RequestMethod.POST)
    String rollbackInit(@RequestBody MirrorRollBackDTO mirrorRollBackDTO, @RequestParam("lang") String lang);

    
    @RequestMapping(value = "/pro/v1/workOrderV2/common/getNodeNameMap", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    String getNodeNameMap(@RequestBody Map<String,Object> slaListDTO, @RequestParam("lang") String lang);

}
